/**
 * 
 */
package com.opengroupe.entities;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @author MMB11447
 *
 */
@Entity
@Table(name = "accesscode", catalog = "qrh")
public class AccessCode implements Serializable {

	private static final long serialVersionUID = -3489980952886094354L;
	
	private String code;
	
	private Date generationDate;

	/**
	 * Default constructor
	 */
	public AccessCode() {
	}

	/**
	 * @return the code
	 */
	@Id
	@Column(name="code", nullable=false, updatable=true, length=14)
	public String getCode() {
		return code;
	}

	/**
	 * @param code the code to set
	 */
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * @return the generationDate
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="genDate", nullable=false, updatable=true)
	public Date getGenerationDate() {
		return generationDate;
	}

	/**
	 * @param generationDate the generationDate to set
	 */
	public void setGenerationDate(Date generationDate) {
		this.generationDate = generationDate;
	}

	/**
	 * @param code
	 * @param generationDate
	 */
	public AccessCode(String code, Date generationDate) {
		super();
		this.code = code;
		this.generationDate = generationDate;
	}

}
